package io.renren.modules.business.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.renren.modules.business.entity.BusAttendrecordEntity;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * 考勤记录
 * @author liao mengqing
 */
@Mapper
public interface BusAttendrecordDao extends BaseMapper<BusAttendrecordEntity> {

    /**
     * 查询所有用户考勤记录
     * @return
     */
    List<Map<String, Object>> attendanceList();

    /**
     * 根据关键字查询用户考勤记录
     * @return
     */
    List<Map<String, Object>> attendanceByKey(String username);

    /**
     * 添加考勤记录
     * @param phone
     * @param type
     * @param labId
     * @param time
     */
    boolean attendance(String phone, int type, Long labId, String time);

    /**
     * 根据手机号查询用户考勤记录
     * @param phone
     * @return
     */
    BusAttendrecordEntity attendByPhone(String phone);

    /**
     * 根据用户手机号查询用户实验室Id
     * @param phone
     * @return
     */
    Long deveLab(String phone);
}
